import req from './http';
import { Env } from '@/types/env.d';
import { ConfigReq, ConfigRes } from '@/types/api.d';

const prefixOptions: Record<Env, any> = {
  dev: {
    apigate: '//apigate-test.10jqka.com.cn',
    eq: '//testm.10jqka.com.cn'
  },
  test: {
    apigate: '//apigate-test.10jqka.com.cn',
    eq: '//testm.10jqka.com.cn'
  },
  release: {
    apigate: '//apigate.10jqka.com.cn',
    eq: '//eq.10jqka.com.cn'
  }
};
const prefix = prefixOptions[import.meta.env.VITE_APP_CURRENTMODE as Env];
// 获取高端产品的配置
export const reqHighendConfig = (params: ConfigReq): Promise<ConfigRes['data']> =>
  req.get(`${prefix.eq}/open/api/dynamic_configuration/v1/config_list`, { ...params });
